<template>
  <dv-border-box-8 style="padding-top: 10px">
    <dv-decoration-7 style="width:100%;height:30px;">生产统计</dv-decoration-7>
    <div style="height: 250px;width: 100%;padding: 5px">
      <dv-scroll-board :config="config" />
    </div>
  </dv-border-box-8>


</template>

<script>


export default {
  name: "Inventory",
  data() {
    return {
      config: {}
    }
  },
  created() {
    this.getList()
  },
  methods: {
    getList() {
      // 静态生产数据
      const staticData = [
        {
          materialName: '光伏板',
          materialModel: 'PV-100',
          materialSpecifications: '1.5m×1m',
          materialUnit: '块',
          totalInventory: 1500,
          quantityProduced: 800,
          producedQuantity: 200,
          totalCarbonEmission: 12000
        },
        {
          materialName: '锂电池',
          materialModel: 'Li-200',
          materialSpecifications: '100Ah',
          materialUnit: '组',
          totalInventory: 3000,
          quantityProduced: 1500,
          producedQuantity: 500,
          totalCarbonEmission: 8500
        }
      ];

      // 配置dv-scroll-board组件
      this.config = {
        header: ['编号', '产品', '型号', '规格', '单位', '库存', '已生产', '待生产', '碳排放'],
        data: [],
        align: ['center'],
        rowNum: 5,
        headerBGC: '#1981f6',
        headerHeight: 45,
        oddRowBGC: 'rgba(0, 44, 81, 0.8)',
        evenRowBGC: 'rgba(10, 29, 50, 0.8)'
      }

      // 将静态数据添加到dv-scroll-board组件的data中
      staticData.forEach((item, index) => {
        this.config.data.push([
          index + 1,
          item.materialName,
          item.materialModel,
          item.materialSpecifications,
          item.materialUnit,
          item.totalInventory,
          item.quantityProduced,
          item.producedQuantity,
          item.totalCarbonEmission
        ])
      })
    }
  },
  mounted() {

  },
  beforeDestroy() {

  }
}
</script>

<style lang="scss" scoped>

</style>
